
import frameWork.entity.NodeDrawBase;
import frameWork.entity.TestDrawNode;
import frameWork.mainComponent.MainAssigner;
import frameWork.mainComponent.MainFrame;
import frameWork.mainComponent.MainTick;
import frameWork.entity.TestNode;
import girvate.Grivate;

import java.awt.*;

public class Main {

    public static void main(String[] args) {
        MainFrame mw=new MainFrame();
        MainAssigner ma=new MainAssigner();

        Grivate g=new Grivate();

        MainTick MainTask= new MainTick(()->{
            int size=g.arr.size();
            //for(NodeDrawBase d :g.arr){
            for(int i=0;i<size;i++){
                    ma.addNode(g.arr.get(i));
            }
            try {
                while (!ma.isAllFinish()) Thread.sleep(1);
            }catch (InterruptedException e){}
            while(!mw.getDrawer().mainPaint());
            mw.getDrawer().repaint();
        });
        MainTask.setTick(50);


//        MainTick MainView= new MainTick(()->{
//        });
//        MainView.setTick(30);

    }
}
